<?xml version="1.0"?>

<st-source>
<time-stamp>From VisualWorks® NonCommercial, 7.5 of 16 April 2007 on 17 Juli 2007 at 12:09:08</time-stamp>
<!-- Bundle MijnGeld Tests* -->
<!-- Package MijnGeld-Domain Tests* -->


<name-space>
<name>MijnGeldTests</name>
<environment>Sepher.MijnGeld</environment>
<private>false</private>
<imports>
			private Smalltalk.*
			private Sepher.*
			private Sepher.MijnGeld.*
			private Sepher.MijnGeldConverter.*
			</imports>
<category>MijnGeld-Domain Tests</category>
<attributes>
<package>MijnGeld-Domain Tests</package>
</attributes>
</name-space>

<class>
<name>AccountTest</name>
<environment>Sepher.MijnGeld.MijnGeldTests</environment>
<super>XProgramming.SUnit.TestCase</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>balanceSheetAccount </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>MijnGeld-Domain Tests</category>
<attributes>
<package>MijnGeld-Domain Tests</package>
</attributes>
</class>

<class>
<name>TestAccountSystem</name>
<environment>Sepher.MijnGeld.MijnGeldTests</environment>
<super>XProgramming.SUnit.TestResource</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars></inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>MijnGeld-Domain Tests</category>
<attributes>
<package>MijnGeld-Domain Tests</package>
</attributes>
</class>

<class>
<name>TestBankAccount</name>
<environment>Sepher.MijnGeld.MijnGeldTests</environment>
<super>XProgramming.SUnit.TestResource</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars></inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>MijnGeld-Domain Tests</category>
<attributes>
<package>MijnGeld-Domain Tests</package>
</attributes>
</class>





<methods>
<class-id>Sepher.MijnGeld.MijnGeldTests.TestAccountSystem</class-id> <category>initialize-release</category>

<body package="MijnGeld-Domain Tests" selector="initialize">initialize
	"Initialize a newly created instance. This method must answer the receiver."

	super initialize.
	" *** Replace this comment with the appropriate initialization code *** "
	^self</body>
</methods>


<methods>
<class-id>Sepher.MijnGeld.MijnGeldTests.AccountTest</class-id> <category>running</category>

<body package="MijnGeld-Domain Tests" selector="testModifyAmountEntryGuarded2">testModifyAmountEntryGuarded2
	| newEntry |
	newEntry := Entry new amount: (Currency newAmount: 13.20).
	newEntry addToAccount: balanceSheetAccount.
	newEntry amount: (Currency newAmount: 13).
	self should: [balanceSheetAccount endBalance amount = 120]</body>

<body package="MijnGeld-Domain Tests" selector="testAddEntry">testAddEntry
	| newEntry oldGuard |
	oldGuard := BalanceSheetAccount guardEndBalance.
	
	[BalanceSheetAccount guardEndBalance: false.
	newEntry := Entry new amount: (Currency newAmount: -13.20).
	newEntry addToAccount: balanceSheetAccount.
	self should: [balanceSheetAccount endBalance amount = (120 - 13.2)]
		description: 'End balance should not change'] 
			ensure: [BalanceSheetAccount guardEndBalance: oldGuard]</body>

<body package="MijnGeld-Domain Tests" selector="testAddEntryGuarded">testAddEntryGuarded
	| newEntry oldGuard |
	oldGuard := BalanceSheetAccount guardEndBalance.
	
	[BalanceSheetAccount guardEndBalance: true.
	newEntry := Entry new amount: (Currency newAmount: -13.20).
	newEntry addToAccount: balanceSheetAccount.
	self should: [balanceSheetAccount endBalance amount = 120]] 
			ensure: [BalanceSheetAccount guardEndBalance: oldGuard]</body>

<body package="MijnGeld-Domain Tests" selector="testModifyAmountEntryGuarded1">testModifyAmountEntryGuarded1
	| newEntry |
	newEntry := Entry new amount: (Currency newAmount: -13.20).
	newEntry addToAccount: balanceSheetAccount.
	newEntry amount: (Currency newAmount: -13).
	self should: [balanceSheetAccount endBalance amount = 120]</body>

<body package="MijnGeld-Domain Tests" selector="testRemoveEntry">testRemoveEntry
	| newEntry |
	newEntry := Entry new amount: (Currency newAmount: -13.20).
	newEntry addToAccount: balanceSheetAccount.
	balanceSheetAccount removeEntry: newEntry.
	self should: [balanceSheetAccount endBalance amount = 120]</body>
</methods>

<methods>
<class-id>Sepher.MijnGeld.MijnGeldTests.AccountTest</class-id> <category>initialize-release</category>

<body package="MijnGeld-Domain Tests" selector="setUp">setUp
	balanceSheetAccount := BalanceSheetAccount new.
	balanceSheetAccount openingBalance: (Currency newAmount: 120)</body>
</methods>


<methods>
<class-id>Sepher.MijnGeld.MijnGeldTests.TestBankAccount</class-id> <category>initialize-release</category>

<body package="MijnGeld-Domain Tests" selector="initialize">initialize
	"Initialize a newly created instance. This method must answer the receiver."

	super initialize.
	" *** Replace this comment with the appropriate initialization code *** "
	^self</body>
</methods>



<bundle-structure>
<name>MijnGeld Tests</name> <structure>#(#(#package 'MijnGeld-Domain Tests'))</structure>
</bundle-structure>

</st-source>
